package com.uuj.project.activitys;

import android.os.Bundle;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.blankj.utilcode.util.ActivityUtils;
import com.uuj.project.R;
import com.uuj.project.base.BaseActivity;
import com.uuj.project.base.BasePresenter;
import com.uuj.project.base.BaseResponse;
import com.uuj.project.listener.IToolBarCallBackListener;
import com.uuj.project.uiview.UIToolBar;
import com.uuj.project.utils.RxBusUtil;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * ProjectName:    ok_rxjava_retrofit
 * Package:        com.uuj.project.activitys
 * ClassName:      RxBusActivity
 * Description:    描述
 * Author:         张继
 * CreateDate:     2019/9/6 11:04
 * UpdateUser:     更新者
 * UpdateDate:     2019/9/6 11:04
 * UpdateRemark:   更新说明
 * Version:        1.0
 */
public class RxBusActivity extends BaseActivity implements IToolBarCallBackListener {
    @BindView(R.id.main_toolbar)
    UIToolBar mainToolbar;
    @BindView(R.id.main_text)
    TextView mainText;
    @BindView(R.id.main)
    LinearLayout main;

    @Override
    protected int setContentView() {
        return R.layout.activity_main;
    }

    @Override
    protected void initData() {
        mainText.setText("rxBus");

    }

    @Override
    protected void initToolbar(Bundle savedInstanceState) {
        mainToolbar.setToolBarClickListener(this);
    }

    @Override
    protected BasePresenter createPresenter() {
        return new BasePresenter(this);
    }

    @OnClick(R.id.main_text)
    public void onViewClicked() {
        RxBusUtil.getInstance().post(new BaseResponse<String>("aaa", 0));
    }

    @Override
    public void onLeftClick() {
        //ActivityUtils.startActivity(MainActivity.class);
        finish();
    }

    @Override
    public void onRightClick() {

    }
}
